/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycompany.yourtrade.common;

import java.util.HashMap;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.ListOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Component;

@Component
@Data
public class RedisService {

    @Autowired
    private RedisTemplate<String, String> template;

    @Resource(name = "redisTemplate")
    private ListOperations<String, String> listOps;

    @Resource(name = "redisTemplate")
    private ValueOperations<String, String> valueOps;

    public void test() {        
//        int i = 0;
//this.valueOps.set(null, null, l, TimeUnit.);
//        HashMap<String, String> map = new HashMap<String, String>();
//        map.put("ok", "abc");
//        map.put("ok1", "shuxu");
//        map.put("ok2", "eg");
//        
//        this.valueOps.set("china", "china");
//        this.template.opsForHash().putAll("where", map);

    }
}
